Part Number Hot Search : 
B1514ERW P2500 SN510 6ABST CMW01Y M54562FP P2500 6ABST
Product Description
Full Text Search
 

To Download Z8FS021XHH20EG Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  ps028806-0315 product specification zmotion ? intrusion detection copyright ?2015 zilog, inc. all rights reserved. www.zilog.com z8fs021
ps028806-0315 life support policy zmotion ? intrusion detection product specification ii do not use this product in life support systems. life support policy zilog?s products are not authorized fo r use as critical components in life support devices or systems without th e express prior written approval of the president and general counsel of zilog corporation. as used herein life support devices or systems are devices which (a) ar e intended for surgical implant into the body, or (b) support or sustain life and whose failure to perform when properly used in accordan ce with instructions for use provided in the labeling can be reasonably expected to result in a significant injury to the user. a critical component is any component in a life support device or system whose failure to perform can be reasonably expected to cause the fa ilure of the life support device or system or to affect its safety or effectiveness. document disclaimer ?2015 zilog, inc all rights reserved . information in this publication con cerning the devices, applications, or technology described is intend ed to suggest possible uses and ma y be superseded. zilog, inc. does not assume liability for or provide a representation of accuracy of the information, devices, or technology described in this document. zilog also does not assume liability for intellectual property infringement related in any manner to use of informati on, devices, or technology described herein or otherwise. the information contained w ithin this document has been verified according to the general principles of electrical and mechanical engineering. zmotion and z8 encore! xp are trademarks or re gistered trademarks of zilog, inc. (an ixys company). all other product or service names ar e the property of their respective owners. warning:
ps028806-0315 revision history zmotion ? intrusion detection product specification iii revision history each instance in the following revision history table reflects a change to this document from its previous version. for more details, re fer to the corresponding pages or appropriate links provided in the table. date revision level description page number mar 2015 06 added note indicating that the device is not preprogrammed and user is required to download generic intrusion detection code (rd0001-sc01) . 2 , 4 , 10 , 47 sep 2014 05 individual lenses and pyros are no longer bundled and can now be ordered separately. therefore, the ordering information, pir engine revisions, and zds ii project settings sections have been updated, and the lens specifications appen dix has been deleted. 47 , 59 oct 2011 04 corrected error in epir_sc1 description, table 9; modified packaging section. 29 , 46 jul 2011 03 corrections to epir_sc1, epir_process_rate and epir_signal_dc registers 29 , 40 , 44 apr 2011 02 corrections to pir noise sensitivity level register and pir transient sensitiv ity level register. 42 feb 2011 01 original issue. all
ps028806-0315 table of contents zmotion ? intrusion detection product specification iv table of contents revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .iii table of contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iv list of figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi list of tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 zmotion intrusion detection features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 z8fs021 mcu features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 z8fs021 mcu block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 mcu part selection guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 pin configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 signal descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 flash memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 ram memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 peripheral availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 pin availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 hardware connection requiremen ts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 white light detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 led requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 pir engine and api . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 pir engine cpu stack usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 standard api register set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 3 advanced api register set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 packaging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 ordering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 zmotion mcu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 pir engine revisions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 related documents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 appendix a. example application schematics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 z8fs021xsb20eg (8-pin device) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Z8FS021XHH20EG (20-pin) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 z8fs021xhj20eg (28-pin) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
ps028806-0315 table of contents zmotion ? intrusion detection product specification v appendix b. pir engine initialization an d control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 appendix c. software support files and project configuration . . . . . . . . . . . . . . . . . . . . . 59 zds ii project settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 customer support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
ps028806-0315 list of figures zmotion ? intrusion detection product specification vi list of figures figure 1. z8fs021 mcu block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 figure 2. 8-pin soic package diagram ? z8fs021x sb20eg . . . . . . . . . . . . . . . . . . 5 figure 3. 20-pin ssop package diagram ? z8fs02 1xhh20eg . . . . . . . . . . . . . . . . . 6 figure 4. 28-pin ssop package pi n-out, z8fs021xhj20eg . . . . . . . . . . . . . . . . . . . 7 figure 5. z8fs021 mcu program memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 figure 6. z8fs021 mcu ram memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 figure 7. example circuit with the z8fs021xsb20eg (8-pin) zmotion intrusion detection mcu 50 figure 8. example circuit with the Z8FS021XHH20EG (20-pin) zmotion intrusion detection mcu, single pyro mode 51 figure 9. example circuit with the Z8FS021XHH20EG (20-pin) zmotion intrusion detection mcu, dual pyro mode 52 figure 10. example circuit with the z8 fs021xhj20eg (28-pin) zmotion intrusion detection mcu, single pyro mode 54 figure 11. required circuit connections for the z8fs021xhj20eg (28-pin) zmotion intrusion detection mcu, dual pyro mode 55 figure 12. application flow diagram, normal scan rate . . . . . . . . . . . . . . . . . . . . . . 57 figure 13. application flow diagram, normal scan rate . . . . . . . . . . . . . . . . . . . . . . 58
ps028806-0315 list of tables zmotion ? intrusion detection product specification vii list of tables table 1. z8fs021 zmotion intrusion detectio n mcu part selection guide . . . . . 4 table 2. z8fs021 mcu signal descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 table 3. peripheral availability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 table 4. pir engine standard api registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 table 5. pir engine enable register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 table 6. pir software enable patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 table 7. pir sensitivity register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 table 8. pir status/control register 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 table 9. pir status/control register 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 table 10. pir status/control register 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 table 11. pir status/control register 3, 20-pin sso p . . . . . . . . . . . . . . . . . . . . . . . . 32 table 12. pir status/control register 3, 28-pin sso p . . . . . . . . . . . . . . . . . . . . . . . . 32 table 13. pir status/control register 3, 8-pin soic . . . . . . . . . . . . . . . . . . . . . . . . . 33 table 14. pir adc result value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 table 15. pir version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 table 16. pir engine api advanced registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 table 17. pir advanced status/control register 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 table 18. pir advanced status/control register 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 table 19. pir advanced status/control register 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 table 20. pir sample size register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 table 21. pir process rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 table 22. pir debounce batch size re gister . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 table 23. pir debounce timeout regist er . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 table 24. pir noise sensitivity level register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 table 25. pir transient sensitivity level register . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 table 26. maximum noise sensitivity values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 table 27. pir signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 table 28. pir extended dete ction sensitivity level . . . . . . . . . . . . . . . . . . . . . . . . . 44 table 29. pir dc signal level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
ps028806-0315 list of tables zmotion ? intrusion detection product specification viii table 30. pir extended de tection debounce timeout . . . . . . . . . . . . . . . . . . . . . . . . 45 table 31. z8fs021 zmotion intrusion detectio n series part selection guide . . . 47 table 32. pir engine revision identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
ps028806-0315 overview zmotion ? intrusion detection product specification 1 overview the zmotion intrusion detection device is an integrated and flexible solution for pas- sive infrared (pir)-based moti on detection applications. th e zmotion family includes a series of high-performance mi crocontrollers with integrated motion-detection algorithms and a selection of lenses and pir sensors to fit a wide range of in trusion detection and security applications. zilog?s zmotion in trusion detection solution provides a dra- matic improvement in both sensitivity a nd stability over traditio nal security-related motion detection designs with integrated func tions such as white li ght detection and pet immunity. as a result, it is the ideal solution for security applicatio ns in which intrusion detection capability is vital. the zmotion intrusion detection solution, based on zilog?s z8fs021 mcu, combines the programmability and rich peripheral set of our z8 encore! xp family of in-circuit programmable flash mcus with built-in motion detection soft ware algorithms to provide the functions necessary for pir motion detectio n applications. these algorithms comprise the pir engine and run in the background while control and status of the engine is accessed through a software application pr ogrammer interface (api). these apis allow designers to create their own application-sp ecific software while taking advantage of zilog?s zmotion motion detect ion technology. additional api settings are provided to match pir engine operation to each lens and pyroelectric sensor combination. the flash in-circuit programming capability of the z8fs021 mcu allows for faster devel- opment time, more flexible manufactur ing and firmware changes in the field. as with all of zilog?s zmotion products, the zmotion intrusion detection mcu pro- vides optimized configuration pa rameters for each lens/senso r combination to ensure the best possible performance while significantly reducing development risk and minimizing time to market. zmotion intrusion detection features ? software-based motion detec tion (pir) engine controlled and monitored via software api registers ? select from an assortment of lenses and pyroele ctric sensors to best fit your application ? api settings provided for each lens and pyroelectric sensor combination ? sensitivity control, range cont rol and directionality detection ? accurate frequency discriminatio n and programmable pet immunity ? no temperature compensation required ? white light detection using status led redu ces system cost (eliminates cds photocell) ? white light anti-jam feature and programmabl e sensitivity to support a wide range of led and light pipe configurations
ps028806-0315 overview zmotion ? intrusion detection product specification 2 ? programmable transient and noise detection z8fs040 mcu features ? high-performance ez8 ? cpu core ? 2 kb in-circuit programmable flas h available for application code the z8fs021 mcu is not preprogammed with application code. a generic version of the zmotion intrusion detection source code ( rd0001-sc01 ) can be downloaded from z ilog.com and programmed into the mcu. ? single-pin debug with unlimited breakpoints ? flexible clocking scheme ? internal precision oscillator running at 5.53 mhz ? external oscillator operating up to 20 mhz ? sigma delta adc ? up to 6 single-ended channels or 3 differential channels available ? on-chip analog comparator with inde pendent programmable reference voltage ? full-duplex uart with dedicated brg ? two 16-bit timers with input capture, outp ut compare and pwm capability (11 modes total) ? watchdog timer (wdt) with de dicated internal oscillator ? up to 20 vectored interrupts ? 6 to 25 i/o pins depending upon package ? 2.7 v to 3.6 v operating voltage with exte nded operating temperature range ?40c to +105c ? low power modes note:
ps028806-0315 overview zmotion ? intrusion detection product specification 3 z8fs040 mcu block diagram figure 1 displays a block diagram of the z8fs040 mcu. figure 1. z8fs040 mcu block diagram register file ram (256b) + api on-chip peripheral power control 2kb flash memory timer 1 gpio program memory bus register file bus timer 0 uart & brg comp v comparator sigma/delta adc adc v irda pir engine interrupt controller on-chip debug flash controller oscillator control wdt + low power oscillator external xtal/rc oscillator 5.53 mhz internal oscillator por & vbo ez8 cpu tm ref ref
ps028806-0315 mcu part selection guide zmotion ? intrusion detection product specification 4 mcu part selection guide table 1 displays the basic features and package styles available for each device within the z8fs021 zmotion intrusion detection mcu devi ces. select the package type that is most suitable to your applica tion based on required general purpose i/os and adc chan- nels. the table suggests references to the pin configuration diagrams for the peripheral functions available on each i/o pin. see the ordering information section on page 47 for a list of all zmotion intrusion detection part numbers. the z8fs021 mcu is not preprogammed with application code. a generic version of the zmotion intrusion detection source code ( rd0001-sc01 ) can be downloaded from z ilog.com and programmed into the mcu. table 1. z8fs021 zmotion intrusion detection mcu part selection guide zmotion mcu part number z8 encore! xp base part number flash memory gpio adc channels package pin configuration diagram z8fs021xsb20eg z8f082asb020eg 2 kb 5 3 8-pin soic figure 2 Z8FS021XHH20EG z8f082ahh020eg 2 kb 16 4 20-pin ssop figure 3 z8fs021xhj20eg z8f082ahj020eg 2 kb 22 6 28-pin ssop figure 4 note: x = pir engine revision identifier (see table 4 on page 23.) note:
ps028806-0315 pin configuration zmotion ? intrusion detection product specification 5 pin configuration the z8fs021 mcu is available in a variety of package styles and pin configurations. this chapter describes the signals and available pi n configurations for each of the package styles. for information about the ph ysical package specifications, see the packaging sec- tion on page 46. figures 2 through 4 display the pin configurations of all the packages available for the zmotion mcu series. for a description of the signals, see tables 6 through 8 on pages 24 through 26. at reset, all port pins are set to gpio input state except /reset/de0/t1out (8-pin) which is configured to /reset, pa0/t0in/t0out/xin/dbg (8-pin), which is config- ured to dbg and reset/pd0 (20- and 28-pin) which are configured to /reset. figure 2. 8-pin soic package diagram ? z8fs021xsb20eg 5 1 2 3 4 6 7 8 vdd vss pa1/t0out/xout/ana3/vref/clkin ana2 pa4/rxd 0/ana1/c inn pa2/reset/de0/t1out pa5/txd0/t 1out/an a0/cin p pa0/t0in/t0out/xin/dbg
ps028806-0315 pin configuration zmotion ? intrusion detection product specification 6 figure 3. 20-pin ssop package diagram ? Z8FS021XHH20EG 1 2 3 4 vdd vs s pb0/a n a0 5 6 7 8 9 10 20 19 18 17 16 15 14 13 12 11 pb 1/a n a1 ana2 ana3 pa0/t0in/t0out/xin pa1/t0out/xout pa2/de0 pa 3/c ts 0 pa4/rxd0 pc3/cout pc2/ana6/led/vref pc1/ana5/cinn pc0/ana4/cinp dbg reset/pd0 pa7 /t1 out pa6/t1in /t 1out pa5 /tx d 0
ps028806-0315 pin configuration zmotion ? intrusion detection product specification 7 figure 4. 28-pin ssop package pin-out, z8fs021xhj20eg 1 2 3 4 vdd vss pb 0/a n a0 5 6 7 8 9 10 28 27 26 25 24 23 22 21 20 19 pb 1/a n a1 ana2 ana3 pa0/t0in/t0out/xin pa1/t0out/xout pb4/ana7 pa3/cts0 pa4/rxd0 pc3/cout pb5/vref pc1/ana5/cinn pc0/ana4/cinp dbg reset/pd0 pa7/t1out pc6 avdd 11 12 13 14 pa2/de0 pc7 18 17 16 15 pc5 pa6/t1in/t1out pa5/txd0 avss pc2 /a n a6 pc4
ps028806-0315 signal descriptions zmotion ? intrusion detection product specification 8 signal descriptions table 2 describes the z8fs021 mcu signals. si gnal availability is package dependent. see the pin configuration section on page 5 for signal availability multiplexing. table 2. z8fs021 mcu signal descriptions signal mnemonic i/o description general-purpose i/o ports a?d pa[7:0] i/o port a. these pins are used for general-purpose i/o. pb[5:0] i/o port b. these pins are used for general-purpose i/o. pc[7:0] i/o port c. these pins are used for general-purpose i/o. pd[0] o port d. this pin is used for general-purpose output only. uart controllers txd0 o transmit data. this signal is the transmit output from the uart and irda. rxd0 i receive data. this signal is th e receive input for the uart and irda. cts0 i clear to send. this signal is the flow control input for the uart. de o driver enable. this signal allows automatic control of external rs-485 drivers. it is approximately the invers e of the transmit empty (txe) bit in the uart status 0 register. the de signal can be used to ensure that the external rs-485 driver is enabled wh en data is transmitted by the uart. timers t0out/t1out o timer output 0C1. these signals are outputs from the timers. t0out/t1out o timer complement output 0C1. th ese signals are output from the timers in pwm dual output mode. t0in/t1in i timer input 0C1. these signals are used as the capture, gating and counter inputs. comparator cinp/cinn i comparator inputs. these signals are the positive and negative inputs to the comparator. cout o comparator output. analog ana[7:0] i analog port. these signals are used as inputs to the analog-to-digital converter (adc). v ref i/o analog-to-digital converter reference voltage input, or buffered output for internal reference.
ps028806-0315 signal descriptions zmotion ? intrusion detection product specification 9 oscillators xin i external crystal input. this pin is the input pin to the crystal oscillator. a crystal can be connected between it and the xout pin to form the oscillator. in addition, this pin is used with external rc networks or external clock drivers to provide the system clock. xout o external crystal output. this pin is the output of the crystal oscillator. a crystal can be connected between it and the xin pi n to form the oscillator. clock input clkin i clock input signal. this pin can be used to input a ttl-level signal to be used as the system clock. led drivers led o direct led drive capability. all port c pins have the capability to drive an led without any other external components. these pins have programmable drive strengths set by the gpio block. on-chip debugger dbg i/o debug. this signal is the control a nd data input and output to and from the on-chip debugger. the dbg pin is open-drain and requires a pull-up resistor to ensure proper operation. reset reset i/o reset. generates a reset when asse rted (driven low). also serves as a reset indicator; the z8 encore! xp forces this pin low when in reset. this pin is open-drain and features an enabled internal pull-up resistor. power supply v dd i digital power supply. av dd i analog power supply. v ss i digital ground. av ss i analog ground. table 2. z8fs021 mcu signa l descriptions (continued) signal mnemonic i/o description caution:
ps028806-0315 flash memory map zmotion ? intrusion detection product specification 10 flash memory map the z8fs021 mcu is based on zilog?s z8f082a device, which contains a total of 8 kb flash memory. zilog?s pir technology is located in the 6 kb address range 0800h?1fffh , a code space that is locked and cannot be erased by the user or by the zilog debug interface (zdi) mass erase or pa ge erase commands. the remaining 2 kb of this flash memory space , in the address range 0000h?07ffh , is available for user appli- cation code. the z8fs021 mcu is not preprogammed with application code. a generic version of the zmotion intrusion detection source code ( rd0001-sc01 ) can be downloaded from zilog.com and programmed into the mcu. a memory map of the z8fs021 mcu?s flash c ode space is illustrated in figure 5. figure 5. z8fs040 mcu program memory map note: reserved for pir engine user application code space (1986 bytes) 1fffh 0800h 07ffh 003eh 0000h 003dh interrupt vectors and option bits
ps028806-0315 ram memory map zmotion ? intrusion detection product specification 11 ram memory map there is a total of 1 kb of ram available on the base z8f082a device. some of this ram (from 070h to 0efh and from 190h to 3ffh ) is used by the zmotion pir engine. the remainder of the ram, from 000h to 06fh and from 110h to 18fh (240 bytes), is available to the application. the mc u control registers are located at the top of memory, from f00h to fffh , and are also available to the application. the area from 400h to effh contains no device memory. see figure 6. the zmotion motion detection api is a series of registers located in the ram memory space in the address range 0f0h?10fh . it is through these memory locations that configura- tion and status are passed between the pir engi ne and the user application. advanced api registers are located in the range 0f0h?0ffh . see the pir engine and api section on page 21 for details about these api registers and to set up the project memory environment. figure 6. z8fs040 mcu ram memory map mcu control registers user application ram (128 bytes) user application ram (128 bytes) reserved for pir engine fffh f00h 3ffh 190h 10fh 100h 0efh 070h effh 400h 18fh 110h 0ffh 0f0h 06fh 000h standard pir api advanced pir api reserved for pir engine
ps028806-0315 peripherals zmotion ? intrusion detection product specification 12 peripherals the following sections describe the differences, changes or limitations placed on any of the z8fs021 peripherals or other functions from the base z8f082a device. for more information about the operation of each periph eral, please refer to the appropriate section of the z8 encore! xp f082a series product specification (ps0228) . peripheral availability table 3 shows how the z8fs040 mcu peripherals are used by zilog?s pir technology and how these peripherals differ from their co unterparts on the base z8f082a device. the peripherals used by the pir engine should not be used by the application unless the engine is disabled through the pir engine enable register . table 3. peripheral availability device z8fs021xsb20eg Z8FS021XHH20EG z8fs021xhj20eg base mcu device z8f082asb020eg z8f082ahh020eg z8f082ahj020eg pins/package 8-pin soic 20-pin ssop 28-pin ssop adc ana1 is used for white light detection when enabled. ana2 is used for pir sensor input. ana3 is used for a second sensor input in dual pyro mode. ana1 is used for white light detection when enabled. ana2 is used for pir sensor input. ana3 is connected to ana6/v ref . ana3 is used for a second sensor input and ana6 becomes available in dual pyro mode. ana1 is used for white light detection when enabled. ana2 is used for pir sensor input. ana3 is connected to v ref . ana3 is used for a second sensor in dual pyro mode. v ref internal v ref used by the pir engine and set to 1 v. internal v ref used by the pir engine and set to 1 v. internal v ref used by the pir engine and set to 1 v. timer 0 available to applicat ion. available to application. available to application. timer 1 available to applicat ion. available to application. available to application. gp i/o pa3/pa1 are multiplexed with ana2/ana3 and used for pir sensor input (ana2 for single pyro mode and ana2/ana3 for dual pyro mode). pb2, pb3 & pc2 are used for pir functions. in dual pyro mode, pc2 becomes available. pb2, pb3 & pb5 are used for pir functions. in dual pyro mode, pb5 becomes available.
ps028806-0315 peripherals zmotion ? intrusion detection product specification 13 the remainder of this section further describes the differences in application availability between the 8-pin, 20-pin and 28-pin peripheral sets. analog to digital signal conversion zilog?s pir technology requires exclusive acce ss to the adc peripheral to detect motion. however, adc conversions can be requested by the application via the api (pir status/ control register 3). if it is necessary for the user application to utilize the adc peripheral directly, the pir engine must first be disabled via the pir engine enable register in the api. motion detection is not po ssible while the pir engine is disabled. when the user application is finished with the adc peri pheral, it must reenable the pir engine. 8-pin device. pa3 (ana2) is reserved as the analog adc input from the pyroelectric sensor. therefore, ana2 is not available fo r user applications. additionally, ana3 is used for a second sensor input in dual pyro mo de. all other channels are available to the user application. 20-pin device. pb2 (ana2) is reserved as the analog adc input from the pyroelectric sensor. therefore, ana2 is not available for user applications. additionally, ana3 and ana6 are not available because pb3 (ana3) must be tied directly to pc2 (ana6/ v ref ). pc2 is configured as v ref output by the pir engine. in dual pyro mode, ana3 is used for a second sensor inpu t rather than being tied to v ref ; ana6/v ref therefore becomes available. all other channels are available to the user application. low power op amp not available not available not available comparator available to application. available to application. available to application. uart available to application C no cts. available to application. available to application. temperature sensor not available. not available. not available. led drive available to application. available to application. wdt available to application. available to application. available to application. adc channel available to application 0y e s 1 yes C used for white light detection 2n o 3 only in single pyro mode table 3. peripheral av ailability (continued)
ps028806-0315 peripherals zmotion ? intrusion detection product specification 14 28-pin device. pb2 (ana2) is reserved as the analog adc input from the pyroelectric sensor. therefore, ana2 is not available for user applications. also, ana3 is not avail- able because it is tied directly to pb5/v ref . pb5 will be configured as v ref output by the pir engine. in dual pyro mode, ana3 is used for a second sensor input rather than being tied to v ref ; pb5 therefore becomes available. all ot her channels are available to the user application. timers the z8fs021 mcu offers two independent an d identical 16-bit multi-function timers, timer 0 and timer 1; both are available to the user application. adc channel available to application 0y e s 1 yes C used for white light detection 2n o 3n o 4y e s 5y e s 6 only in dual pyro mode adc channel available to application 0y e s 1 yes C used for white light detection 2n o 3n o 4y e s 5y e s 6y e s 7y e s timer 0 8-pin device t0out is not available in dual pyro mode; it is configured as ana3 to support a second sensor input. all other external timer 0 functions are available for the user application.
ps028806-0315 peripherals zmotion ? intrusion detection product specification 15 watchdog timer no changes or limitations are placed on wd t functions by the pir engine; the wdt is available to the user application. comparator 20-pin device all external timer 0 functions are available for the user application. 28-pin device all external timer 0 functions are available for the user application. timer 1 8-pin device t1in is configured as ana2 to support the signal input from the pyroelectric sensor and is not available to the user application. a ll other timer 1 functions are available. 20-pin device all external timer 1 functions are available for the user application. 28-pin device all external timer 1 functions are available for the user application. 8-pin device the external pin that carries cout is configured as ana2 to support the signal input from the pyroelectric sensor. however, the comparator is still able to generate an interrupt internally without cout. 20-pin device all external comparator functions are available for the user application. 28-pin device all external comparator functions are available for the user application.
ps028806-0315 peripherals zmotion ? intrusion detection product specification 16 uart oscillator control all devices can be operated with the internal 5.54 mhz ipo. for app lications that require more processing power or a more accurate tim e base, an external crystal oscillator or ceramic resonator can be used. when using the 8-pin device, external oscilla tor support is limited to single pyro mode only, because ana3 (the adc input for a s econd pyro sensor) is multiplexed with x out . the 20- and 28-pin devices can be operated with an external oscillator in both single and dual pyro modes. do not operate at frequencies lower than the ipo frequency while the pir engine is en- abled or motion detection performance will be degraded. no other changes or limitations are placed on oscillator control functions by the pir engine. flash memory the control registers associated with flash me mory are all available to the application. the pir engine uses the value programmed into the flash frequency registers (ffreq) to determine the required sample rate of the adc and other functions. the flash fre- quency high (ffreqh) and flash frequency low byte (ffreql) registers must be pro- grammed prior to initializing the pir engine . these two registers combine to form a 16- bit value, ffreq. this value is the system clock frequency in khz and is calculated using the following equation. ffreq[15:0] = {ffreqh[7:0],ffreql[7:0]} = (system clock frequency)/1000 8-pin device /cts0 is configured as ana2 to support the signal input from the pyroelectric sensor. it is therefore not available to the user applic ation. the uart is still able to function correctly without /cts when ctse in the u0ctl0 register is set to 0. 20-pin device all external uart fu nctions are available for the user application. 28-pin device all external uart fu nctions are available for the user application. caution:
ps028806-0315 peripherals zmotion ? intrusion detection product specification 17 interrupt controller no changes or limitations are placed on th e interrupt controller functions by the pir engine. temperature sensor the temperature sensor is not tested or calibra ted (trim bits are not available). therefore, this peripheral is not availa ble on any of the z8fs040 devices. low-power operational amplifier the ampinp signal is multiplexe d with ana2 which is used for the pyro sensor input. therefore, this peripheral is not available on any of the z8fs040 devices. non-volatile data storage there is no dedicated non-volatile da ta storage on the z8fs040 devices. pin availability although most pins on the zmotion mcu series are available to th e application, some pins are dedicated to supporting the functions of the pir engine. this section describes which pins are reserved and which are available to the application. the pins used by the pir engine are automatically configur ed when the engine is initialized. general-purpose input/output all of the general purpose i/os are available ex cept for those used for the pir circuit. see appendix a. example application schematics on page 49 for more information. 8-pin device pin 5 (ana2) is reserved as the analog adc input from the pyroelectric sensor. any other functions multiplexed with pin 5 (pa3//cts0, cout and t1in) are not available for user applications. in dual pyro mode, in which the application us es 2 pyroelectric sensors, pin 3 (ana3) is used as an analog adc input for a second sensor and is therefore not available for other functions (t0out/v ref /clkin). 20-pin device pin 2 (ana2) is reserved as the analog adc input from the pyroel ectric sensor. in single pyro mode, pin 3 (ana3) must be externally tied to v ref on pin 18 (pc2/ana6/led/ v ref ). pc2 will be configured as the v ref output by the pir engine when it is enabled. in dual pyro mode (supporting 2 pyroelectr ic sensors), pin 3 (ana3) is used for the second sensor. in this mode the pin 18 v ref signal is not connec ted externally to any other adc inputs and is therefore ava ilable to the application (pc2/ana6/led/v ref ).
ps028806-0315 hardware connection requirements zmotion ? intrusion detection product specification 18 hardware connection requirements this section describes the required external hardware connection for the zmotion mcu series. see appendix a. example application schematics on page 49 for example sche- matic diagrams showing these connections. pins are automatically configured to their re quired function when the pir engine is initial- ized via the epir_init macro. the device ca n be operated in single pyro mode when supporting one pyroelectric sen sor or in dual pyro mode when supporting two pyroelec- tric sensors. both of these modes can be operated in normal or low scan rate modes. depending on the application, there can be up to four connection requirements supporting these modes: one for each of two pir senso rs, one for the adc and one for the white light detection and status led. a description of each of these elements follows in this section. for a broader description of the white light detection component, see the white light detection section on page 19. pyroelectric pir sensor #1 the signal from the pir sensor is connected di rectly to the ana2 input of the adc. the adc is configured for differential buffered mode by zilog?s pir technology. the sensor signal should be connected directly to the adc input with no add itional signal condition- ing circuitry unless specified by the pyroelectric sensor manufacturer. adc v ref the on-chip v ref is configured for 1v of nominal voltage. the pir sensor signal is con- nected to the positive (+) differentia l input of the adc (ana2), and the v ref signal is connected to the negative (?) differential in put (ana3). the 8-pin device provides an internal connection from v ref to ana3 to support this conf iguration; therefore, no exter- nal hardware connection is required. the 20- and 28-pin devices require an external con- nection from the v ref output signal to the adc negative (?) (ana3) input. pyroelectric pir sensor #2 in dual pyro mode, the adc is still used in differential buffere d mode (i.e., as is true for single pyro mode). the sign al from the second pir sensor is connected to ana3. the 28-pin device pin 1 (ana2) is reserved as the analog adc input from the pyroel ectric sensor. in single pyro mode, pin 4 (ana3) must be externally tied to v ref on pin 3 (pb5/ v ref ). pb5 will be configured as v ref output by the pir engine when it is enabled. in dual pyro mode, which supports 2 pyroelectr ic sensors, pin 4 (ana 3) is used for the second sensor. in this mode the pin 3 v ref signal is not connected externally to any other adc inputs and is therefore available to the application (pb5/v ref ).
ps028806-0315 white light detection zmotion ? intrusion detection product specification 19 v ref signal is no longer connected to ana3 ne gative (?) adc input. the fist pir sensor is connected to the positive (+) adc input (ana2) as it is in single pyro mode. the v ref signal is still used internally for the ad c, but the external pin is unused in dual pyro mode. white light detection and status led when enabled via the white li ght threshold field in the pir status/control register 2 , the pir engine automatically performs adc co nversions on the ana1 input. the signal on this input should be propor tional to the amount of white lig ht to which the pir sensor is being subjected. typically, this pin would be connected to a high-efficiency (status) led which generates a small voltage in the presence of white light . the pir engine configures the pin to a (single-ended) analog input, perform the necessary adc conversion and reconfigure it to a digital output. see the fo llowing white light detection section for more information about the ope ration of this mode. white light detection due to the nature of the pyroelectric sensor, sudden large changes in white light will cause a dc shift in the signal output, which could potentially generate a false motion event. sources such as car headlights have been know n to cause this issue. the pir engine can monitor this occurrence and be configured to ignore the event. when light hits the pyroelectric sensor, its energy is co nverted into a signal output. if the pattern and intensity of the light is optimal, then the signal can appear exactly like a motion event. however, the pir engine can determine when the sen sor is being exposed to light and use this information to filter out an invalid motion event. when enabled via the white light threshold (w lt) bits in the epir_sc2 register (see table 10 on page 31), the pir engine automatically performs adc conversions on ana1, which should be connected to a high-e fficiency led (typically a status led). when light shines on an led , it generates a small voltage which the pir engine can mea- sure. the pir engine reconfigures the pin to an analog input and performs the necessary adc conversion. the system should be configur ed such that if light is shining on the led, it is also shining on the pir sensor. as a result, it is advisable to avoid placing the led behind a lens with white light filtering. when the engine detects a sudden change in voltage on ana1 greater than the value set in the white light threshold field of epir_sc2, the motion detection algorithms auto- matically compensate for the a ssociated signal level shift from the pyroelectric sensor (caused by the light simultaneously shining on the led and the pyroelectric sensor). this compensation allows the pir engine to suppress false motion events caused by white light while still detecting real motion events. however, sensitiv ity is reduced during this period. the white light detected bit of the epir_asc0 register is set to indicate the
ps028806-0315 white light detection zmotion ? intrusion detection product specification 20 detection of white light and stays set until clea red by the application. no other action is required by the application. additionally, an anti-jam feature is available via bit 5 of the epir_asc0 register to pre- vent intentional jamming of th e detector. when anti-jam is on, the engine looks for con- tinuous white light events occurring within a short time span (for example, a malicious intruder continuously flashing a br ight light onto the detector). after 12 white light events within a short time period, the engine automatically begins ignoring the white light events and returns to normal motion detection. the engine begins responding to white light events after a period wi thout white light events. when white light detection mode is enable d by programming the white light threshold bits in pir status/control register 2 (epir_ sc2), the application is not required to per- form any other functions. the pir engine pe rforms all required ta sks related to white light immunity. the white light detected bit in pir status/control register 1 simply provides the application with an indicatio n that a white light event has occurred. led requirements the pir engine uses the voltage generated by the led connected to ana1 to determine the level of white light to which the system is being subjected. while most high-efficiency leds will perform correctly for this function, th ere are certain requirements placed on the specifications of the led that is used in the system. these requirements are: ? do not place the led behind any white light f iltering material. if it is behind a lens or a light pipe, these materials should be transparent to white light. ? ensure that the light source for the led is originating from the same general direction as the pir sensor. it is important that the pir sensor and the led receive the light at the same time. ? leds are available with a large range of electrical specifications. the white light threshold detection bits in the epir_sc02 register allow the pir engine the flexibil- ity to work with many led types, but gene rally leds that are more efficient at gener- ating a voltage from a light source perfo rm better as white light detectors. ? most high-efficiency leds in red, yellow or green with a forward voltage drop less than 2 v @ 2 ma are well suited for white light detection.
ps028806-0315 pir engine and api zmotion ? intrusion detection product specification 21 pir engine and api the zmotion mcu series is developed upon the z8 encore! xp -based z8f082a mcu with the added functionality of a motion de tection (pir) engine. the pir engine is located in the upper 4 kb area of the 8 kb de vice, leaving 4 kb of code space to the user application. the pir engine operates in the background and is controlled and monitored via an application programmer interface (api). the api is a series of reserved registers in memory. there are two sections to the api: standard api registers and advanced api registers, as described below. standard api registers. these registers include all of the status and control functions required by most applicatio ns. these include sens itivity control, motion detection/direc- tion status and operational modes. advanced api registers. these registers provide additiona l control over the pir engine operation and allows it to be configured to support the pyroelectric sensor and lens being used in the application. pir engine timer tick bit 7 of pir status/control register 1 provides a one-second time base for the pir engine to perform housekeeping operatio ns. this bit must be set to 1, once per second by the user application. the bit is checked and cl eared during the epir_adc_isr routine. pir engine entry points there are two entry points to the pir engine that are accessed via two predefined macros ? one is an initialization macro that is used to start the e ngine and the other is executed upon every adc interrupt. both macros save and initialize the register pointer, perform a call to the pir engine entry point and then r estore the register pointer before returning control to the application. it is the responsibility of the applicatio n software to execute these macros at the appropriate time. epir_init macro. this macro is executed to initialize th e pir engine after reset. it is nor- mally only executed once and is used in conjunction with the pir engine enable register in the standard api section. the application should initialize all api registers, write the pir enable pattern to the pir engine enable register, then execute this macro. adc con- versions are started by this macro. epir_init macro: pushx rp ldx rp, #%e0 call %1ffd popx rp
ps028806-0315 pir engine and api zmotion ? intrusion detection product specification 22 cpu cycles: 261 peripherals initialized: adc and gpio, de pending on api-selected options. the adc irq is set for medium priority. epir_adc_isr macro. this macro is executed for e ach adc conversion. the applica- tion handles the adc interrupt and executes th is macro. all motion detection processing is performed by this macro. epir_adc_isr macro: pushx rp ldx rp, #%e0 call %1000 popx rp the cpu cycles used by the epir_adc_isr macro vary depending on engine state and configuration. pir engine cpu stack usage the pir engine shares the processor stack with the user application. there are no special requirements on the placement of the stack in memory, but it is essential that the user pro- vide enough stack space for both the user application and the pir engine. the pir engine requires a maximum 6 bytes of stack.
ps028806-0315 standard api register set zmotion ? intrusion detection product specification 23 standard api register set the standard api register set, shown in tabl e 4, is a series of re gisters implemented in the z8fs040 mcu ram that allows the user code to configure and communicate with the pir engine. the default values are loaded on ly when the pir engine is enabled via the pir enable register. table 4. pir engine standard api registers api register name address mnemonic description pir engine enable register (epir_enable) 100h epir_enable enable pir engine. pir sensitivity register (epir_sensitivity) 101h epir_sensitivity motion sensitivity. pir status/control register 0 (epir_sc0) 102h epir_sc0 motion status and engine mode control. pir status/control register 1 (epir_sc1) 103h epir_sc1 engine status and control. pir status/control register 2 (epir_sc2) 104h epir_sc2 range control. pir status/control register 3 (epir_sc3), 28-pin ssop 105h epir_sc3 adc scan request. pir adc result value (epir_adc_result) 10ah/10bh epir_adc_resu lt adc scan result. pir version (epir_version) 10ch epir_version pir engine software version.
ps028806-0315 standard api register set zmotion ? intrusion detection product specification 24 tables 5 through 15 describe each of the standard api registers listed in table 4. table 5. pir engine enable register (epir_enable) bit 76543210 field pir enable/disable pattern control read/write address 100h pir enable/disable pattern (bits 7?0) pir enable/disable register; controlled by the application. ? the pir enable register controls the overall operation of the pir engine. as an added level of protection, there are specific 8-bit enable and disable values; a ll other values are reserved. reading this register returns the last value written. once enab led, the pir engine reads the application-controlled status/control register values and sets the engine-controlled va lues to their default states. ? to enable the pir engine, first write the epir_e nable_pattern to the pir enable register, then execute the epir_init macro. see table 6. table 6. pir software enable patterns pattern name description 00h epir_disable_pattern disables all pir engine functions, including motion detection. used to temporarily or permanently shut down the engine. 11h epir_enable_pattern enables the pir engine. all primary engine functions, as configured in engine status/c ontrol registers, are enabled. confirmation of enabled status is provided through the engine disabled bit in status/control register 0.
ps028806-0315 standard api register set zmotion ? intrusion detection product specification 25 table 7. pir sensitivity register (epir_sensitivity) bit 76543210 field sensitivity default uuuuuuuu control read/write address 101h sensitivity (bits 7) pir sensitivity setting; controlled by the application. the pir sensitivity register is used to adjust the sensitivity of the pir engine to targ et motion. lower values produce high er sensitivity to motion, with 00h being the most sensitive and ffh being the least sensit ive. the user application should load this register with the appropriate value to provide the appropriate se nsitivity. this parameter acts as a motion signal duration check. a smaller se nsitivity value means that the duration of a valid motion signal can be shorter. a larger sensitivity value means a valid motion signals duration must be longer. notes: 1. the setting of this register also affects the range of detection. lower values increase range and higher values decrease range. 2. depending on the lens and pyroelectric sensor used, values above 3fh can result in very limited detection.
ps028806-0315 standard api register set zmotion ? intrusion detection product specification 26 table 8. pir status/control register 0 (epir_sc0) bit 76543210 field extended detection engine disabled md suspend motion direction control motion direction motion detected pir stable control r/w r r/w r/w r r/w r address 102h extended detection level (bits 7?6) sets the sensitivity level of the extended detector; controlled by the application. ? these two bits enhance the motion detection algorithms to detect slower, faster and/or more subtle motion. the extended detection level is selected to provide a balance between additional sensitivity while maintaining stability (n o false detections). in ce rtain applications such as lighting control, the extended detection level can be increased wh en normal motion has been detected. extended detection is dependent on the lens pattern used. smaller lens beams tend to provide more subtle motion detection. ? the extended detection level affects user contro l over the range provided in epir_sc2. as the extended detection level is increased, th e range setting becomes less effective. 00 = extended detection level 0 C minimum (least sensitive). 01 = extended detection level 1. 10 = extended detection level 2. 11 = extended detection level 3 C high (most sensitive). engine disabled (bit 5) pir engine disable/suspend acknowledged; controlled by the pir engine. ? this bit indicates the operational status of and is controlled by the pir engine. when the engine is initialized and enabled by loading the pir enabl e register with the epir_enable_pattern value, this bit is cleared to indicate that the engine is r eady. when the engine is disabled by loading the pir enable register with the epir_disable_pattern, it will respond by setti ng this bit to 1 and perform no further operations until reenabled. for the engine to detec t that it has been disabled, the user must allow the engine adc interrupt to run at least once after loading the pir enable register with the epir_disable_pattern. 0 = engine is enabled and operational. 1 = engine is disabled and not operational.
ps028806-0315 standard api register set zmotion ? intrusion detection product specification 27 md suspend (bit 4) motion detection suspend; controlled by the application. ? temporarily suspends the pir engine from running an d places it in a very low processing overhead state and can be used when the application requires significant cpu processing power. while suspended, motion detection is disabled; however, to ensure fast recovery from this mode, adc interrupts still occur and samples continue to be bu ffered. when the applicat ion clears this bit, suspend mode is exited upon the next adc interrupt. 0 = normal motion detection. 1 = suspended motion detection. motion direction control (bit 3) motion direction control enable; controlled by the application. ? this bit enables directional motion detection. the rela tive direction of the detected motion is indicated in bit 2 (motion direction) of this same register. when configured as a directional detector (bit 3 set to 1), direction is indicated in bit 2 as a po sitive or negative relative to the pir sensor. 0 = standard motion detection mode. motion is de tected in any direction; the motion direction status bit (bit 2) is not valid. 1 = directional motion detection mode. motion is de tected in any direction; relative direction is indicated via the motion dire ction status bit (bit 2). ? the directional polarity of pir sensors is arbitrar y at the time of manufacturing. therefore, it is necessary for the user application to calibrate to eac h individual pir sensor using a controlled target (i.e. moving in a known direction) and internally recording the polarity to identify which polarity represents that direction. motion direction (bit 2) relative direction of last motion detected; controlled by the pir engine. when directional motion detection is enabled, this bit indicates the relative direction of the last motion detected. when the pir engine sets the motion detected bit in pir status register 0, this bit is set or cleared to indicate the direction of the motion. the st atus is latched until the user application clears the motion detected bit. 0 = last detected motion was negative. 1 = last detected motion was positive. this status bit is undefined when motion direction control is disabled. motion detected (bit 1) motion detected on pir sensor set by the pir engine; cleared by the application. this bit indicates that the engine has detected a mo tion event. the user application should routinely check this bit to determine if motion has been detected. this bit is set by the engine and must be cleared by the user application. 0 = no motion detected by the engine. 1 = motion has been detected by the engine.
ps028806-0315 standard api register set zmotion ? intrusion detection product specification 28 pir stable (bit 0) passive infrared (pir) sensor signal stab ilized bit; controlled by the pir engine. after periods of non-us e, the pir sensor will take some time to stabilize before it can be used reliably. the amount of time is dependent on the pir sensor being used as well as environmental conditions; it can range from a few seconds to as much as on e minute. to relieve the application software from having to assume a worst-case st abilization time, the pir engine automatically mo nitors the dc offset of the pir sensor and sets this bit when it determines that it has become stable. this bit indicates that the pir sensor has stabilized after one of the following conditions: ? after initial power on (cold start). ? after re-enabling the engine via pir enable register. ? after returning from sleep mode. 0 = pir sensor signal is not stable; motion detected events are not valid. 1 = pir sensor signal is stable; motion detected events are valid.
ps028806-0315 standard api register set zmotion ? intrusion detection product specification 29 table 9. pir status/control register 1 (epir_sc1) bit 76543210 field engine timer tick frequency response pir scan rate 2-pulse mode dual pyro enable control r/w read/write r/w r/w r/w address 103h engine timer tick (bit 7) pir one-second timer tick set by the application; cleared by the pir engine. ? this bit must be set to 1 one time per second by the user application to provide the engine with a one- second tick to perform ho usekeeping operations re lating to motion detection. the engine will routinely poll this bit to obtain a one-secon d tick. this bit is cleared by the engine. 0 = cleared by the pir engine. 1 = a one-second interval has occurred. frequency response (bits 6?3) frequency response of pir engi ne; controlled by application ? this value determines the frequen cy response of the motion detect ion system. higher values allow lower frequencies to be accepted by the pir engine. lower values cause the engine to ignore targets that generate lower frequencies. these targets typically include horiz ontally oriented objects such as pets. ? the frequency of the signal that is presented to the pir engine is largely dependent on the structure of the pir lens being used (numbe r and dispersion of beams). a lens with several evenly distributed beams provides better frequency response performance than a lens with an uneven beam distribution. note: lower programmed values also have the effect of reducing the relative range of detection. the valid range is 0 (disabled) to a maximum value de termined by the window size selected in the pir advanced status/control register 2 . the maximum frequency response values for each window size can be summarized as: window size max frequency re sponse value small fh medium fh large ch
ps028806-0315 standard api register set zmotion ? intrusion detection product specification 30 pir scan rate (bit 2) pir adc conversion rate for the pyroelectr ic sensor; controlled by the application. ? the pir engine performs the necessary adc conver sions on the pir sensor input. each conversion generates an interrupt that is pr ocessed by the pir engine from the epir_adc_isr macro. the pir scan rate bit determines th e rate at which the adc conversions are generated. ? in normal scan rate mode (pir scan rate se t to 0), the z8fs021 adc peripheral is set to continuous conversion mode which causes a conversion to be carried out automatically every 256 system clocks. in this mode, the application is only required to execute the epir_adc_isr macro for each adc interrupt. the adc continually runs and continuously generates interrupts. ? when low scan rate mode is selected by setting this bit to a 1, continuous conversion mode is disabled and the adc is operated in single-shot m ode such that each conversion takes 5129 system clocks to complete. in this mode, the application software must initiate the adc conversion request (set bit 7 of adcctl0) and execute t he epir_adc_isr macro once every 5 ms. ? in low scan rate mode, the adc is disabled be tween conversions to redu ce power consumption. power consumption can be reduced further if the a pplication software uses this mode in conjunction with the cpus halt or stop mode s. alternately, this mode can be used to provide the application software with additional cpu processing time. ? although the low scan rate mode provides th e application with more processing power and the opportunity for th e system to reduce power co nsumption, the normal sc an rate will provide better sensitivity and range. while operating in low scan rate mode, sensitivity is reduced by approximately 20%. the performance of direction de tection can also be reduced in this mode. emc immunity is disabled while in low scan rate mode. ? emc immunity features, such as transient sensitivit y and noise sensitivity, ar e disabled while in low scan rate mode. ? if the pir scan rate bit is chang ed during engine operatio n, the engine will stop detecting motion for up to 200 ms to avoid potential false motion detection. when changing the pir scan rate mode, the advanced api registers must first be updated with the appropriate values. 0 = normal scan rate mode 1 = low scan rate mode 2-pulse enable (bit 1) 2-pulse detection mode enable; controlled by application this bit determines if motion detection requires o ne or two motion pulses as the target passes across the beams created by the fresnel lens . with a pulse count of 1, a sing le motion pulse from the target is required to qualify as valid moti on. a pulse count of 2 requires two motion pulses from the target C one positive and one negative C to qualify as valid motion. a pulse count of 2 is typically used in harsher environmental conditions to decrease the chan ces of false triggers from sources such as fast heating and cooling. 0 = one pulse of motion required for detection. 1 = two pulses of motion required for detection.
ps028806-0315 standard api register set zmotion ? intrusion detection product specification 31 dual pyro mode (bit 0) dual pyroelectric sensor signaling mode; controlled by the application. ? this bit determines if the pir engine should accept signals from one or tw o pyroelectric sensors. ? when configured for single pyro operation, only one sensor is used (c onnected to ana2). when configured for dual pyro operation, the engine will scan two se nsors simultaneously. dual pyro mode is typically used to provide a larger area of covera ge. the second pyroelectric sensor is connected to input ana3. in dual pyro mode, motion on either sensor will g enerate a motion detected event. 0 = single pyroelectric sensor mode. 1 = dual pyroelectric sensor mode. table 10. pir status/control register 2 (epir_sc2) bit 76543210 field white light threshold range control control read/write read/write address 104h bits 7?3 reserved white light detection threshold* controlled by application ? these bits determine how sensitive the white light de tector is to changes in detected white light. larger values cause the white light detector to be less sensitive. a value of 00000 disables white light detection. the light is sensed via the led connected to the ana1 pin. light shining on the led creates a small current that can generate enough voltage on the pin to measure changes accurately. the pir engine automatically configures the adc to single- ended buffered mode and performs the necessary conversions and pr ocessing. see the white light detection section on page 19 for a description of white light operation. note: *this register is ignored in low power mode; white light detection is disabled by lower power mode. range control (bits 2?0) motion detection range control; controlled by the application. ? these bits determine the relative range of motion detection; larger values decrease the range of detection. this parameter acts as a motion signal amplitude check. a smaller range value means that a valid motion signals amplitude can be lower. a larger range value means that a valid motion signals amplitude must be higher. ? typical values used for range control are dependent on the lens and pyroelec tric sensor being used. range is also dependent on target size, speed and relative temperature. for example, a range control setting that rejects one target of a particular size at a given distance does not guarantee that a larger target will be rejected at the same distance.
ps028806-0315 standard api register set zmotion ? intrusion detection product specification 32 table 11. pir status/control register 3, 28-pin ssop (epir_sc3) bit 76543210 field ana7 scan request ana6 scan request ana5 scan request ana4 scan request reserved buffered mode ana1 scan request* ana0 scan request control r/w r/w r/w r/w 0 r/w r/w r/w address 105h note: *ana1 is reserved for white light detection wh en enabled via pir status/control register 2. table 12. pir status/control register 3, 20-pin ssop (epir_sc3) bit 76543210 field reserved ana6 scan request ana5 scan request ana4 scan request reserved buffered mode ana1 scan request* ana0 scan request control 0 r/w reserved in single pyro mode r/w r/w 0 0 r/w r/w address 105h note: *ana1 is reserved for white light detection wh en enabled via pir status/control register 2.
ps028806-0315 standard api register set zmotion ? intrusion detection product specification 33 table 13. pir status/control register 3, 8-pin soic (epir_sc3) bit 76543210 field reserved reserved reserved reserved ana3 scan request reserved ana1 scan request* ana0 scan request control 0000 r/w reserved in dual pyro mode 0r/wr/w address 105h note: *ana1 is reserved for white light detection wh en enabled via pir status/control register 2. anax scan request analog channel 0, 1, 3-7 scan requested bits set by the application; cleared by the pir engine. these bits allow the user application to request th e engine to perform an a/d conversion on the non- reserved analog in puts. when requested, the engi ne will reconfigure the appropr iate i/o pin to a single- ended, unbuff ered input using a 2 volt reference. it will then take the next sample and store it in the pir adc result value registers and clear all anax scan request bits. the i/o configuration for the anax pin is not returned to its previous configuration by the engine. if r equired, the user application must perform this task. if multiple request bits are set simultaneously, the engine w ill only scan the lo west-numbered adc channel requested and ignore any ot her requests. the user application should set one request bit, then poll it to determine when the conversion is complete and the data is ready. when adc scan requests are being serviced by the pir engine, adc c onversions on the pir sensor are suspended. therefore, the user application should be careful no t to continuously request adc scans. the pir process rate register in the advanced api register set section can be monitored to ensure the engine is receiving enough time to perform its required pir sensor adc scans. 0 = no conversion requested/ last conversion completed. 1 = perform a conversion on this channel.
ps028806-0315 standard api register set zmotion ? intrusion detection product specification 34 table 14. pir adc result value (epir_adc_result) bit 1514131211109876543210 field adc result value control read address 10ah 10bh pir adc result value (bits 0?15) adc scan request result value controlled by pir engine the pir adc result value contains the result of the last application requested adc conversion. the data format is identical to that discussed in the z8 encore! xp product specification (ps0228) for registers adcd_h and adcd_l. example for requesting an ana0 conversion: ? set bit 0 (ana0 scan request) in pir status/control register 3 (epir_sc3). ? wait until the ana0 scan request bit is cleared by the engine. ? read the adc conversion result from the pir adc result value register. note: even though the adc result value is a 16 bit register, atomic operations are not r equired since the value is only updated at the request of the application. table 15. pir version (epir_version) bit 76543210 field version control read address 10ch version (bits 0?7) pir engine software version; controlled by the pir engine. ? the value stored in this register indicates the software version of the pir engine. value pir engine software version 11h 2.00
ps028806-0315 advanced api register set zmotion ? intrusion detection product specification 35 advanced api register set the registers are for advanced configuration of the pir engine. they include customiza- tion for lens and pyroelectric sensor configurations. these registers are not initialized by the pir engine. table 16. pir engine api advanced registers api advanced register name address mnemonic description pir advanced status/control register 0 f0h epir_asc0 engine control and status. pir advanced status/control register 1 f1h epir_asc1 white light debounce and scan rate. pir advanced status/control register 2 f2h epir_asc2 window size, lock level, and window update rate. pir engine process rate f3h/f4h epir_process_rate relative processing available to the pir engine. pir sample size register f5h epir_sample_size controls amount of sensor signal averaging. pir debounce time register f6h epir_debo unce_time controls time to debounce motion signal. pir debounce batch size register f7h epir_debounce_batch controls out of window samples required for debounce. pir transient sensitivity level f8h epir_trans ient_sense sets pir engine sensitivity to transient detection. pir noise sensitivity level f9h epir_noise_s ense sets pir engine sensitivity to noise detection. pir pyro signal fah/fbh epir_signal current pyro sensor signal sample. pir pyro dc signal level fch/fdh epir_signal_dc current calculated pyro sensor dc offset. pir extended detection sensitivity level feh epir_extended_sense controls sensitivity of extended detector. pir extended detection debounce timeout ffh epir_extended_timeout controls.
ps028806-0315 advanced api register set zmotion ? intrusion detection product specification 36 table 17. pir advanced status/control register 0 (epir_asc0) bit 76543210 field external v ref white light detected white light anti-jam buffer refresh new sample md origin em noise detected em transient detected control r/w r/w r/w r/w r/w r r/w r/w address f0h external v ref (bit 7) select between internal or external v ref ; controlled by the application. ? this bit selects between internal and external v ref for the adc when scanning the pir sensor. when set to 0, internal v ref is used and it is automatically set to 1v when the pir engine is initialized via the epir_init macro. when set to a 1, external v ref is selected and a regulated 1v signal must be supplied to this pin by the user. th e advantage of using an external v ref is that it is affected less by internal operations of the mcu like high drive on an output pin. 0 = internal v ref selected. 1 = external v ref selected. ? note: this regist er affects the v ref selection for adc scans of the pir s ensor only. adc channel scan requests made through epir sc3 always use an internal 2v reference. white light detected (bit 6) white light detected on led; cleared by the application. ? this bit is set by the pir engine when a white light event has been detected. this status is provided to the user application to indicate that a white light event has occurred an d associated false motion event(s) may have been suppressed by the engine. th is bit is set by the engine and must be cleared by the user application. the threshold or amount of light required to trigger a white light event is controlled by the white light threshold bits in pir status/control register 2. ? if white light detection is disabled (white light threshold=00000), this bit is undefined and should be ignored by the user application. white light anti-jam (bit 5) stop malicious jamming of the detector via continuo us white light events; controlled by the application. ? white light anti-jam is used to prevent a repetitive white light signal from jamming motion detection. without anti-jam a constant source of white light even ts can indefinitely inhibit motion detection. with anti-jam enabled, after 12 white light events within a short duration , the engine will begin to ignore them and return to regular motion detection. after a period of no white light events, the engine will begin looking for white light events again. the feature is intended to prevent malicious jamming of the detector. 0 = white light anti-jam disabled. 1 = white light anti-jam enabled.
ps028806-0315 advanced api register set zmotion ? intrusion detection product specification 37 buffer refresh (bit 4) uses a fast fill algorithm to quickly refill the motion detection buffer s; controlled by the application. ? this bit is used to restart motion detection by quickly reinitializin g and refilling the motion detection constructed sample buffers. this can be used as a method to restore motion detection after waking up from sleep mode or it can be used to help ignore external events that can cause false detections. ? waking up from sleep mode ? if this bit is set when the epir_ init macro is executed the engine re-fills the constructed sample buffers with a fast fill algorithm th at allows it to quickl y restore motion detection. typi cally, a simple external wake-up circuit would be implemented that provides an unqualified motion detection signal to wake up the mcu from sleep mode (smr). up on smr, the application would set the buffer refresh bit, execute epir_init, and then continue with normal motion detection functions for some period of time before returning to sleep mode. by setting this bit prior to epir_init, the engine buffers are filled much fast er enabling it to analyze the original signal seen by the external wake up circuit and determine if it is 'real' motion. ? ignoring false detection events ? if the mcu is used to control external components (l ed's, relays, lights, triac's, etc) a fluctuation on the power supply can be created as the external device is turned on or off. the buffer refresh bit can be used to ignore any false detection that could be created by these fluctuations. when the external device is turned on or off, the application can set the buffer refresh bit to effectively reset the motion detection history and therefore ignore any effect from the external device. new sample (bit 3) new sample available from pir signal high/low r egister; set by the pir engine, cleared by the application. ? this bit indicates that the pir engine has a new sensor signal input sample available that can be read by the application. this status is available as an advanced feature as the application is not normally required to read the sampled pir sensor signal. th e application must clear this bit when the sample has been read. md origin (bit 2) origin of last motion detection event; controlled by the pir engine. ? this bit indicates how the pir engine detected the la st motion detected event. when the engine sets the motion detected bit in epir_sc0, it also se ts this bit according to which detection engine registered the event. 0 = normal motion detector 1 = extended motion detector em noise detected (bit 1) new sample available from pir signal high/low re gister; set by the pir engine, cleared by the application. ? this bit indicates that the pir engine has a new sensor signal input sample available that can be read by the application. this status is available as an advanced feature as the application is not normally required to read the sampled pir sensor signal. th e application must clear this bit when the sample has been read.
ps028806-0315 advanced api register set zmotion ? intrusion detection product specification 38 use the following equation to determin e the white light scan rate, in seconds: larger values create a slower sample rate, which results in slower white light response. smaller numbers will increase white light ev ent response at the cost of potentially degrading motion detection. em transient detected (bit 0) em transient detected on pir signal; set by the pir engine; cleared by the application. ? this bit indicates if the engine has detected a tran sient on the pir signal. this event is provided to the user application to indicate that an em transient event has occurred and associated motion event(s) may have been suppressed by the engine. th is bit is does not have to be read for normal operation and is provided as status only. the applic ation must clear this bit after it has been read. table 18. pir advanced status/control register 1 (epir_asc1) bit 76543210 field white light debounce white light scan rate control r/w r/w address f1h white light debounce (bits 7?4) white light debounce time; controlled by the application. ? this value determines the amount of debounce applied to the white light detection. white light debounce is the number of sequential wl samples above the threshold value set in the pir status/ control register 2 required to consider it as a wl event. larger numbers result in more stable white light detection at the cost of slower white light response. 0 = internal v ref selected. 1 = external v ref selected. white light scan rate (bits 3?0) white light (led) scan rate; c ontrolled by the application C see the equation that follows. ? this value determines the rate (in seconds) at which the white light signal is sampled. wl scan is performed at a maximum rate of once every 5 pir co nstructed samples when th is value is set to 0. the pir constructed sample time is determined by the pir sample size register . each increment of 1 to the white light scan rate value adds 5 cons tructed samples to the time between white light scans. ?? ? ? frequency clock system ratescan light white size sample epir __ 1___*4873 __*1280 ? ?
ps028806-0315 advanced api register set zmotion ? intrusion detection product specification 39 table 19. pir advanced status/control register 2 (epir_asc2) bit 76543210 field lock level window size window update rate control r/w r/w r/w address f2h lock level (bits 7?5) controlled by the application. ? this parameter sets the minimum slope change in the signal that can be considered valid motion. this prevents small signal changes caused by environmental or v cc shifts from causing a false detection. use this value in combination with pir sensitivity and range contro l settings to balance sensitivity and stability to the particular lens an d pyroelectric se nsor being used. C smaller values allow subtle signals with lower slopes to be considered motion events at the expense of potential false motion events. C larger values allow the system to ignore smaller signal slope changes at the expense of potentially missing smaller motion events. window size (bits 4?3) controlled by the application. ? this register determines the size of the control limit window. a larger window size produces more stable control limits at the cost of additional cpu usage. if a smaller window size is used, the more frequently the window can be calculated whic h allows it to tra ck the signal better. 00 = reserved. 01 = small window. 02 = medium window. 03 = large window. window update rate (bits 2?0) controlled by the application. ? this register determines how frequently the cont rol limits are calc ulated. it is measured in pir samples. a smaller number produces more frequent calculations which allow th e control limits to track the signal better, at the cost of increased cpu usage. the valid range is 0 to 7. ? the window is updated every 4 + (window update rate * 2) pir samples.
ps028806-0315 advanced api register set zmotion ? intrusion detection product specification 40 table 20. pir process rate (epir_process_rate) bit 1514131211109876543210 field pir process rate control read address f3h f4h epir process rate (bits 15?0) controlled by the pir engine. ? the pir process rate indicator is provided by th e engine to determine if the user application process and interrupts overhead is impacti ng the performance of the engine. if the engine process rate drops significantly, its ability to detect mo tion can be significantly reduced. this value is typically used at the application development stage. this number gives an indication of how much cpu time the engine is receiving. higher numbe rs are better. generally, if the process rate drop s below 0080h, the ability to detect motion could be compromised. note: the 16-bit value provided by these two 8-bit regist ers must be read as an atomic operation by the application. this read can be ensured by using either the cpu's atm instruction or by disabling interrupts while reading the two 8-bit registers. table 21. pir sample size register (epir_sample_size) bit 76543210 field pir sample size control read/write address f5h pir sample size (bits 7?0) controlled by the application. ? this register controls the amount of averaging t hat the engine performs on the incoming pir signal adc samples. more averaging improves signal noise immunity at the cost of a slower sample rate.
ps028806-0315 advanced api register set zmotion ? intrusion detection product specification 41 table 22. pir debounce timeout register (epir_debounce) bit 76543210 field pir debounce time control read/write address f6h pir debounce time (bits 7?0) controlled by the application. ? this register controls the amount of time that the engine will wait to fully debounc e a motion signal. longer times result in detection of subtle motion at the cost of more potential false motion detections. valid range is from 01h to ffh. ? using a value less than the value in the pir sens itivity register will result in no motion detection. table 23. pir debounce batch size register (epir_debounce_batch) bit 76543210 field pir debounce batch size control read/write address f7h pir debounce batch size (bits 7?0) controlled by the application. ? this register determines the number of consec utive out-of-window samples required in order to consider the sequence a valid debounce count. the field works as a mask. increasing the mask size (i.e. more bits set to 1) will increase the noise immunity of the en gine but result in lower sensitivity to subtle motion signals. ? valid values are 01h, 03h, 07h, 0fh, 1fh, 3fh, 7fh and ffh.
ps028806-0315 advanced api register set zmotion ? intrusion detection product specification 42 table 24. pir transient sensitivity level register (epir_transient_sense) bit 76543210 field reserved pir transient sensitivity control 0 read/write address f8h reserved (bit 7) this bit is reserved and must be 0. transient sensitivity (bits 6?0) controlled by the application. ? this register determines how sensitive the transien t detection part of the engine is to sudden changes in the pir signal. a lower number makes the engine mo re sensitive at the cost of potential rejection of large signal motion (for example, a warm target very close to the detector). the valid range is 0 (disabled) to 64h. table 25. pir noise sensitivity level register (epir_noise_sense) bit 76543210 field reserved pir nois e sensitivity control 0 read/write address f9h reserved (bit 7) this bit is reserved and must be 0. noise sensitivity (bits 6?0) controlled by the application C see table 26 for values. ? this register determines how sensitive the noise detection part of the engine is to random broadband noise in the pir signal. a lower number makes the noise detector more sensitive at the cost of potential rejection of small-signal motion (for example, a small delta between the ambient and target temperatures, or a distant target). the valid range is 0 (disabled) to a maximum value determined by the window size selected in the pir advanced status /control register 2 .
ps028806-0315 advanced api register set zmotion ? intrusion detection product specification 43 table 26 summarizes the maximum noise se nsitivity values for each window size. table 26. maximum noi se sensitivity values window size max pir noise sensitivity value typical value small 0ch 08h medium 1dh 12h large 46h 2d table 27. pir signal (epir_signal) bit 1514131211109876543210 field pir signal control read address fah fbh pir signal (bits 15?0) controlled by the pir engine. ? these registers contain the last pir signal obtained by the engine. each time the engine generates a new pir signal samp le it will place it in these registers and set the new sample bit in the pir advanced stat us/control 0 register. this gi ves the application direct vi sibility to the pir generated signal for debugging purposes. ? note: the 16 bit value provided by these two 8 bit regi sters must be read as an atomic operation by the application. this can be ensured by either using the cpu's atm instruction or by disabling interrupts while reading the two 8 bit registers.
ps028806-0315 advanced api register set zmotion ? intrusion detection product specification 44 table 28. pir dc signal level (epir_signal_dc) bit 1514131211109876543210 field pir signal dc control read address fch fdh pir signal dc (bits 15?0) controlled by the pir engine. ? these registers contain the last pir signal dc level calculated by the engine. each time the engine generates new control limits it will place the dc comp onent level in these registers. ? note: the 16 bit value provided by these two 8 bit regi sters must be read as an atomic operation by the application. this can be ensured by either using the cpu's atm instruction or by disabling interrupts while reading the two 8 bit registers. table 29. pir extended detection sensitivity level (epir_extended_sense) bit 76543210 field pir extended detect ion sensitivity control read/write address feh extended detection sensitivity (bits 7?0) controlled by the application. ? this register determines how sensitive the extended de tection part of the engine is to fast or slow speed targets in the pir field of view. a lower numb er makes the extended detector more sensitive, at the cost of potential false motion events. th e valid range is 1 (most sensitive) to 255 (least sensitive) with typical values between 6 and 25. related control features include the pir extended detection level (pir_sc0) and the pir extended detection debounce timeout.
ps028806-0315 advanced api register set zmotion ? intrusion detection product specification 45 table 30. pir extended detection debounce timeout (epir_extended_timeout) bit 76543210 field pir extended detection debounce timeout control read/write address feh extended detection debounce timeout (bits 7?0) controlled by the application. ? this register determines how long the extended detection part of the engine waits for a motion event to be confirmed. a higher number makes the extended detector wait longer, at the cost of potential false motion events. the valid range is 1 (short d ebounce) to 255 (long debounce) with typical values between 3 and 30. related control features include the pir extended detection level (pir_sc0) and the pir extended detection sensitivity level.
ps028806-0315 packaging zmotion ? intrusion detection product specification 46 packaging zilog?s intrusion detection solution takes advantage of the z8fs021 mcu, which is available in the following three packages: ? 8-pin small outline integrated circuit package (soic) ? 20-pin small shrink outline package (ssop) ? 28-pin small shrink outline package (ssop) ? current diagrams for each of the se packages are published in zilog?s packaging product specification (ps0072) , which is available free for do wnload from the zilog website.
ps028806-0315 ordering information zmotion ? intrusion detection product specification 47 ordering information the zmotion intrusion fam ily pir motion detection so lution can be ordered as a stand-alone mcu that includes th e pir motion detection engine. zmotion mcu table 31 displays the basic features and pa ckage styles available for each device within zilog?s line of z8fs021 zmotion intrusion detection mcu devices. for more information about ordering your zmotion intrusion detection device, contact your local zilog representative, distribu tor or sales office. the zilog website ( www.zilog.com ) lists all regional offices and prov ides additional pr oduct information. the z8fs021 mcu is not preprogammed with application code. a generic version of the zmotion intrusion detection source code ( rd0001-sc01 ) can be downloaded from zilog.com and programmed into the mcu. pir engine revisions table 32 displays the current pir engine ve rsions and part number engine revision identifier used to order the zmoti on mcu offerings listed in table 31. table 31. z8fs021 zmotion intrusion detection series part selection guide zmotion mcu ? part number* z8 encore! xp base part number flash memory gpio adc channels package z8fs021 x sb20eg z8f082asb020eg 2 kb 5 3 8-pin soic z8fs021 x hh20eg z8f082ahh020eg 2 kb 16 4 20-pin ssop z8fs021 x hj20eg z8f082ahj020eg 2 kb 22 6 28-pin ssop zmotions200zcog zmotion intrusion detection 20-pin development kit *where x = pir engine revision identifier (see table 32). table 32. pir engine revision identifiers version part number engine revision identifier description 1.00 internal release. 20-pin version only. 2.00 a initial production release. 20-pin version only. note:
ps028806-0315 related documents zmotion ? intrusion detection product specification 48 related documents additional information about the zmotion family of motion detection mcus can be found in the following documents, which are available from the zilog website at www.zilog.com . please refer to the base part number in the z8 encore! xp f082a series product specifi- cation (ps02 28 ) for all mcu functions, fe atures and specifications not covered in this document. document number description pb0230 zmotion intrusion product brief ps0286 zmotion lens and pyroelectr ic sensor produc t specification ps0228 z8 encore! xp ? f082a series product specification wp0017 a new pir motion detection architecture white paper wp0018 zmotion detection lens and pyro sensor configuration guide other zmotion family products ps0285 zmotion detection and control product specification pb0225 zmotion detection and control product brief ps0284 zmotion detection module product specification pb0223 zmotion detection module product brief
ps028806-0315 appendix a. example application schematics zmotion ? intrusion detection product specification 49 appendix a. example application schematics whether you choose to employ single or dual pyro modes using 8-pin, 20-pin or 28-pin zmotion intrusion detection pa ckages, this appendix offers assistance toward creating your circuit design. z8fs021xsb20eg (8-pin device) figure 7 shows an example circuit for the 8-pin version of the zmotion intrusion detection mcu. the interface to the pyroelect ric sensor is via the dedicated input ana2 (pin 5). the status led is driven by pin 6, which is normally configured as a gpio by the applica- tion to control the state of the led. when white light detection is enabled, the pir engine automatically reconfigur es this pin to an adc inpu t to perform the necessary adc conversion and returns it to a gp io when conversion is complete. pin 2 is used as the debug input to the chip, but can be used for other functions as required. pin 4 is set up for the reset function, but can also be used for other functions as the appli- cation requires. pull-up resistors (10k ? ) are provided on the debug and reset signals as required for the debug interface. the signals on pins 3 and 7 can be used as re quired by the application. the power supply design remains available to application requirements. in dual pyro mode, the second pyroelectric sensor is connected to pin 3 (ana3). all other connections remain the same.
ps028806-0315 appendix a. example application schematics zmotion ? intrusion detection product specification 50 figure 7. example circuit with the z8fs021xsb20eg (8-pin) zmotion intrusion detection mcu ? vd d p a1 /t0 ou t / xou t /a n a3 /vr e f/ c l k in pa0/t0 in/t0out/xin//dbg pa2/reset /de0/t1out vs s an a 2 pa4/rxd0/ana1 /cinn pa5 /t xd 0 / t1 ou t /a n a0 / c in p z8 fs021xhh20eg 1 2 3 4 8 7 6 5 vd d ( 3 .3 v) 1u f 1uf 1 2 3 4 5 6 vcc reset gnd dbg gnd nc 47k 10k 10 k debug h eader pyro ele ctric senso r vd d gnd sig 47 0 status l ed & white l ight detection vd d ( 3 .3 v ) ava ilable to applica tion available to application
ps028806-0315 appendix a. example application schematics zmotion ? intrusion detection product specification 51 Z8FS021XHH20EG (20-pin) examples of single and dual pyro circuit designs employing the 20-pin zmotion intru- sion detection mcu are described in this section. single pyroelectric sensor figure 8 shows an example circuit for th e 20-pin zmotion intr usion detection mcu with a single pyroelectric sensor. the interface to the pyroelectric sens or is via the dedi- cated input ana2 (pin 2). v ref (pin 18) must be externally tied to ana3 (pin 3). this is considered internal v ref and bit 7 of pir_asc0 is set to '0' since it is being generated by the internal voltage refer- ence. if an externally generated voltage reference is to be used, tie it directly to ana3 (pin 3) and v ref (pin 18) and set bit 7 of pir_asc0 to '1'. the status led is driven by pin 1 (pb1/ana1) which is normally configured as a gpio by the application to control the state of the led. when white light detection is enabled, the pir engine automatically reconfigures this pin to an adc input to perform the neces- sary adc conversion and returns it to a gpio when done. pin 15 is dedicated as the debug pin and is connected to pin 4 of the debug header. pin 14 is set up for the reset function, but can also be used as pd0 (general purpose i/o) as the application requires. pull-up resistors (10k) are provided on the debug and reset signals as required for the debug interface. all ot her signals can be used as required. the power supply design remains ava ilable to application requirements. figure 8. example circuit with the z8fs021xhh20e g (20-pin) zmotion intrusion detection mcu, single pyro mode 10k vdd (3.3v) 1 2 3 4 5 6 vcc reset gnd dbg gnd nc debug head er Z8FS021XHH20EG 1 2 3 4 14 16 15 17 vd d 6 5 7 10 20 19 18 13 12 11 8 9 pb1/ana1 ana2 ana3 pa0/t0in/t0out/xin vss pa1/ t 0out/xout pa 2 / d e0 pa4 /rxd0 pa3/cts0 pb 0 / an a 0 pc3 /co ut p c 2 / an a 6 / l ed /v ref pc1/ana5/cinn pc 0 / a n a4 /c i n p dbg pa7 /t1out pa 5 /t xd 0 reset / pd0 pa6/ t1i n/t 1out 10 k vdd (3.3v) 1uf 1u f 47 k pyro electric sensor vdd gnd sig 470 vdd (3. 3v) status l ed & white li ght de tecti on
ps028806-0315 appendix a. example application schematics zmotion ? intrusion detection product specification 52 dual pyroelectric sensors in dual pyro mode, the second pyroelectric se nsor is connected to ana3. the signal from v ref to ana3 is not required. in this design example, the internal v ref is used with pir_asc0 bit 7 set to '0'. the user coul d choose to use an externally generated v ref source in which case it would be connected to pin 18 and pir_asc0 bit 7 would be set to '1'. all other connections remain the sa me as single pyro mode. see figure 9. figure 9. example circuit with the z8fs021xhh20e g (20-pin) zmotion intrusion detection mcu, dual pyro mode 10k vd d ( 3 . 3 v) 1 2 3 4 5 6 vc c reset gnd dbg gnd nc de bug h eader z8fs021 xhh20eg 1 2 3 4 14 16 15 17 vd d 6 5 7 10 20 19 18 13 12 11 8 9 pb1/ana1 ana2 ana3 pa0/t0in /t0 out/xin vs s pa 1/t0out/xout pa 2 /d e 0 pa4/rxd0 pa 3/ c ts 0 pb0/ana0 pc3 /cout pc2/ana6/led /v ref pc1/ana5/cinn pc 0 /a n a4 /c i n p dbg pa7/t1 out pa5 /txd0 r ese t /p d 0 pa6/t1in/t1 out 10k vdd (3. 3v) 1uf 1u f 47 k pyro electric sensor 1 vdd gnd sig 47 0 vdd (3. 3v) status led & whit e ligh t detection 1u f 47 k pyro electric sensor 2 vdd gnd sig vdd (3. 3v)
ps028806-0315 appendix a. example application schematics zmotion ? intrusion detection product specification 53 z8fs021xhj20eg (28-pin) examples of single and dual pyro circuit designs employing the 28-pin zmotion intru- sion detection mcu are described in this section. single pyroelectric sensor figure 10 shows an example circuit for the 28 pin device of the zmotion intrusion detection mcu with a single pyroelectric se nsor. the interface to the pyroelectric sensor is via the dedicated input ana2 (pin 1). v ref (pin 3) must be externally tied to ana3 (pin 4). this is considered internal v ref and bit 7 of pir_asc0 is set to '0' since it is being generated by the internal voltage reference. if an exte rnally generated voltage refer- ence is to be used, tie it dire ctly to ana3 (pin 4) and v ref , (pin 3) and set bit 7 of pir_asc0 to '1'. the status led is driven by pin 28 (pb1/ana1 ) which is normally configured as a gpio by the application to control the state of the led. when white light detection is enabled, the pir engine automatically reconfigures this pin to an adc input to perform the neces- sary adc conversion and returns it to a gpio when done. pin 22 is dedicated as the debug pin and is connected to pin 4 of the debug header. pin 21 is set up for the reset function, but can also be used as pd0 (general purpose i/o) as the application requires. pull-up resistors (10k) are provided on the debug and reset signals as required for the debug interface. all ot her signals can be used as required. the power supply design remains ava ilable to application requirements.
ps028806-0315 appendix a. example application schematics zmotion ? intrusion detection product specification 54 figure 10. example circuit with the z8fs021xhj2 0eg (28-pin) zmotion intrusion detection mcu, single pyro mode 10 k vdd (3.3v) 1 2 3 4 5 6 vcc reset gnd dbg gnd nc debug header 10 k vdd (3.3v) 1uf z8fs021xh h20eg 1 2 3 4 22 24 23 25 vdd 6 5 7 10 28 27 26 21 20 19 8 9 pb 1 / an a 1 an a2 an a3 pa0/t0in/t 0out/xin vss pa 1/ t0 ou t /xou t pa 2/ d e 0 pa 4 /r x d 0 pa 3 /c t s0 pb 0 /an a 0 pc3/cou t pb5/v ref pc1/ana5/cinn pc0/ana4/cinp dbg pa 7 /t1 ou t pa 5 /t xd 0 reset/pd 0 pa6/t1in/t1 out 11 14 12 13 18 17 16 15 p b 4 / an a7 av d d avss pc5 pc4 pc6 pc7 pc 2 / an a 6 1u f 47 k py ro e le c tri c sensor vd d gnd si g vdd (3 .3v) 47 0 status led & white light detection
ps028806-0315 appendix a. example application schematics zmotion ? intrusion detection product specification 55 dual pyroelectric sensors in dual pyro mode, the second pyroelectric se nsor is connected to ana3. the signal from v ref to ana3 is not required. in this design example, the internal v ref is used with pir_asc0 bit 7 set to 0. the user could choose to use an externally generated v ref source in which case it would be connected to pin 3 and pir_asc0 bit 7 would be set to 1. all other connections remain the same as single pyro mode. see figure 11. figure 11. required circuit connections for th e z8fs021xhj20eg (28-pin) zmotion intrusion detection mcu, dual pyro mode 10k vd d ( 3 .3 v) 1 2 3 4 5 6 vcc reset gnd dbg gnd nc debug header 10k vdd (3.3v) 1uf Z8FS021XHH20EG 1 2 3 4 22 24 23 25 vd d 6 5 7 10 28 27 26 21 20 19 8 9 pb 1 /an a1 an a2 an a3 pa0 / t0 in /t0 o u t/x in vss pa 1 /t0 ou t/x out pa2/de0 pa4/rxd0 pa3/cts0 pb 0/ an a0 pc3/cout pb5 / v re f p c1 / an a5 /c i nn p c0 / an a4 /c in p dbg pa 7/t1ou t pa5/txd0 re se t/pd 0 pa6 / t1 in /t1 o u t 11 14 12 13 18 17 16 15 pb4/ana7 av dd avs s pc5 pc4 pc6 pc7 pc 2 /a na 6 1uf 47k pyro electric se n so r 1 vd d gnd si g vd d ( 3 .3 v) 470 st a t us le d & wh i t e l i gh t detection 47k pyro electric sensor 2 vd d gnd si g
ps028806-0315 appendix b. pir engine initialization and control zmotion ? intrusion detection product specification 56 appendix b. pir engine initialization and control the application software must execute an initialization procedure to enable the pir engine. once the pir engine is enabled, it runs in the backgrou nd from the adc inter- rupt. every adc conversion generates an interrupt and the pir engine performs its func- tions during this time. the user application co de runs in the foreground and monitors the status through the api and performs any ot her functions required for the application. the pir engine also requires a one-second tick to perform several house-keeping opera- tions and to keep track of its sampling rate. this one-second time base must be provided by the user application through status/control register 1 (engine timer tick). this bit should be set to 1 at the rate of once per s econd by the application software to provide the engine with a one-second time base. the accuracy of this timin g is not critical, but should be within +/? 10%. there are two basic modes in which the pir en gine operates: normal scan rate mode and low scan rate mode. see the descriptio n of the pir scan rate bit in the pir status/con- trol register 1 on page 29 for more details. the pir engine runs in the background from the adc interru pt (initiated by the applica- tion). engine processing is done during th e adc interrupt. therefore, cpu loading is based on the sample rate of the adc. to ensure a consistent sample ra te, the engine must know the mcu operating (system clock) freque ncy. it uses the flash frequency control registers to determine the operating frequency, which must be initialized prior to starting the engine. the flash frequency high (ffreqh) and fl ash frequency low byte (ffreql) regis- ters combine to form a 16-bit value ffreq pr imarily to control timing for flash program and erase functions. this value is also used by the pir software engine to calculate the required sample rate of the adc and other functions. the 16-bit value for ffreq is the system clock frequency in khz and is calculated using the following equation: ffreq[15:0] = {ffreqh[7:0],ffreql[7: 0]} = (system clock frequency) / 1000 the process for initializing the pir engine is common to both normal scan rate and low scan rate modes. the sequence goes as follows: 1. set up the api control regi sters (standard and advanced). 2. initialize the ffreqh and ffreql regist ers with the mcu clock frequency. 3. write the pir enable pattern to the pir enable register. 4. call the pir init. 5. initialize any application-spec ific i/os and peripherals. 6. enable interrupts. 7. ensure that the pir sensor stable bit (pir_sc0:0) is set. 8. continue with the application.
ps028806-0315 appendix b. pir engine initialization and control zmotion ? intrusion detection product specification 57 the flow diagram shown in figure 12 displa ys the general software operation for normal scan rate mode. figure 12. application flow diagram, normal scan rate ? execu te epir_adc_isr ma cro monito r e pir api for eve nts reset initialize api registers recommended settings supplied in lens/pyro configuration file pir sca n r ate = 0 use r app lica tion co de s et e pir_ ena ble regist er to epir_enable_pattern execute epir_init macro enter adc in terrupt exit adc in terrupt set bit 7 of epi r_sc1 (engine timer tick) 1 s eco nd timer interrupt return wa it for pi r sen sor sta ble epir_ sc0:0 =1 epir initiali za tio n adc interrupt one secon d tim e r t ic k main app lication loop i nitialize flash fr eq uen cy r eg iste r en ab le adc in pw rctl 0 initialize oscillator & wdt se t up gpi os for application se t up time r f or 1 seco nd inte rrup t e nab le glob al in terru pts halt (o pti on al ) app lica tion initialization
ps028806-0315 appendix b. pir engine initialization and control zmotion ? intrusion detection product specification 58 the flow diagram shown in figure 13 displa ys the general software operation for low scan rate mode. figure 13. application flow diagram, normal scan rate ? set bit 7 of epir_sc1 (e ng in e timer tick) 5 millisecond timer in terrup t re tu rn on e s e co nd timer tick start next adc sa mple execute epir_adc_isr ma cro 1 second? no ye s 5 mill isecond adc scan monitor epir ap i fo r events reset initialize api registers recommended settings supplied in lens/pyro configuration file pir scan rate = 1 user ap plicat io n code set epir_enable register to epir_enable_pattern execute epir_init macro w a it for p ir se nso r sta ble epi r_sc0 :0 =1 epir initialization main appli cation loop initialize flash frequency register en ab le adc in pw rctl 0 initialize oscillator & wdt set up gpios for application s et u p timer f or 5 milliseco nd in terrup t e nable g lobal interrupts halt (opt io na l) ap plicat io n initialization turn of f adc to conserve power en ter a dc interrupt exit a dc interrupt adc interrupt
ps028806-0315 appendix c. software support files and project configuration zmotion ? intrusion detection product specification 59 appendix c. software support files and project configuration the following four files are prov ided to support the pir engine: pir_api.c. contains the api register definitions and locates them at there appropriate places in memory. pir_api.h. provides the bit definitions for the api registers and also contains the macro definitions for epir_init and epir_adc_isr. api_init_xx.h. this header file contains the default api settings specific to the lens and pyroelectric sensor being used. the applicatio n code loads the api registers with these values prior to executing the epir_init macro. several versions of these files are avail- able from the zilog website with tested conf igurations supporting th e available lenses and pyroelectric sensors. these header files are in cluded as the source code associated with the zmotion detection lens and pyro sensor configuration guide (wp0018) . refer to wp0018 and to the zmotion lens and pyroelectric sensor product specification (ps0286) to select the appropriate api_init_xx file for the selected lens. startupepir.asm. this c start-up file replaces startups.asm or startupl.asm in zds ii. it contains the environm ent initialization, stack, and re gister pointer configurations specifically required for a zmotion project. zds ii project settings the zilog developer studio integrated deve lopment environment (z ds ii ide) is used for software development. beca use the compiled application co de has no vision into the operation of the pir engine, it is important to ensure that the application?s working ram area is not affected by engine operations. to facilitate th is, the pir engine uses working register group e (in the address range e0h?efh ) as its working ram area, and the appli- cation code uses working regi ster group 0 (as defined in startupepir.asm ). these operations are automatically ha ndled by the compiler, and ex amples are provided with the available sample projects. the small memory model must be used for the application soft- ware.
ps028806-0315 customer support zmotion ? intrusion detection product specification 60 customer support to share comments, get your technical questio ns answered, or report issues you may be experiencing with our products, please vi sit zilog?s technical support page at ? http://support.zilog.com . to learn more about this product, find additional documentation, or to discover other fac- ets about zilog product offerings, please visit the zilog knowledge base at http:// zilog.com/kb or consider participating in the zilog forum at http://zilog.com/forum . this publication is subject to replacement by a later edition. to determine whether a later edition exists, please vis it the zilog website at http://www.zilog.com .


▲Up To Search▲   

 
Price & Availability of Z8FS021XHH20EG

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X